/**
 * <copyright>
 * </copyright>
 *

 */
package org.eclipse.gittab.gitTabDsl.util;

import java.util.List;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gittab.gitTabDsl.Beat;
import org.eclipse.gittab.gitTabDsl.Chord;
import org.eclipse.gittab.gitTabDsl.ChordDefinition;
import org.eclipse.gittab.gitTabDsl.ChordLibrary;
import org.eclipse.gittab.gitTabDsl.DownStroke;
import org.eclipse.gittab.gitTabDsl.Fret;
import org.eclipse.gittab.gitTabDsl.GitTabDslPackage;
import org.eclipse.gittab.gitTabDsl.GuitarStr;
import org.eclipse.gittab.gitTabDsl.Hold;
import org.eclipse.gittab.gitTabDsl.Import;
import org.eclipse.gittab.gitTabDsl.Note;
import org.eclipse.gittab.gitTabDsl.NoteName;
import org.eclipse.gittab.gitTabDsl.NoteWrapper;
import org.eclipse.gittab.gitTabDsl.Pause;
import org.eclipse.gittab.gitTabDsl.Sound;
import org.eclipse.gittab.gitTabDsl.Stroke;
import org.eclipse.gittab.gitTabDsl.Tab;
import org.eclipse.gittab.gitTabDsl.TabModel;
import org.eclipse.gittab.gitTabDsl.Tone;
import org.eclipse.gittab.gitTabDsl.Tuning;
import org.eclipse.gittab.gitTabDsl.UpStroke;

/**
 * <!-- begin-user-doc -->
 * The <b>Switch</b> for the model's inheritance hierarchy.
 * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
 * to invoke the <code>caseXXX</code> method for each class of the model,
 * starting with the actual class of the object
 * and proceeding up the inheritance hierarchy
 * until a non-null result is returned,
 * which is the result of the switch.
 * <!-- end-user-doc -->
 * @see org.eclipse.gittab.gitTabDsl.GitTabDslPackage
 * @generated
 */
public class GitTabDslSwitch<T>
{
  /**
   * The cached model package
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected static GitTabDslPackage modelPackage;

  /**
   * Creates an instance of the switch.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public GitTabDslSwitch()
  {
    if (modelPackage == null)
    {
      modelPackage = GitTabDslPackage.eINSTANCE;
    }
  }

  /**
   * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @return the first non-null result returned by a <code>caseXXX</code> call.
   * @generated
   */
  public T doSwitch(EObject theEObject)
  {
    return doSwitch(theEObject.eClass(), theEObject);
  }

  /**
   * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @return the first non-null result returned by a <code>caseXXX</code> call.
   * @generated
   */
  protected T doSwitch(EClass theEClass, EObject theEObject)
  {
    if (theEClass.eContainer() == modelPackage)
    {
      return doSwitch(theEClass.getClassifierID(), theEObject);
    }
    else
    {
      List<EClass> eSuperTypes = theEClass.getESuperTypes();
      return
        eSuperTypes.isEmpty() ?
          defaultCase(theEObject) :
          doSwitch(eSuperTypes.get(0), theEObject);
    }
  }

  /**
   * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @return the first non-null result returned by a <code>caseXXX</code> call.
   * @generated
   */
  protected T doSwitch(int classifierID, EObject theEObject)
  {
    switch (classifierID)
    {
      case GitTabDslPackage.TAB_MODEL:
      {
        TabModel tabModel = (TabModel)theEObject;
        T result = caseTabModel(tabModel);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case GitTabDslPackage.IMPORT:
      {
        Import import_ = (Import)theEObject;
        T result = caseImport(import_);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case GitTabDslPackage.TUNING:
      {
        Tuning tuning = (Tuning)theEObject;
        T result = caseTuning(tuning);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case GitTabDslPackage.GUITAR_STR:
      {
        GuitarStr guitarStr = (GuitarStr)theEObject;
        T result = caseGuitarStr(guitarStr);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case GitTabDslPackage.CHORD_LIBRARY:
      {
        ChordLibrary chordLibrary = (ChordLibrary)theEObject;
        T result = caseChordLibrary(chordLibrary);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case GitTabDslPackage.CHORD_DEFINITION:
      {
        ChordDefinition chordDefinition = (ChordDefinition)theEObject;
        T result = caseChordDefinition(chordDefinition);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case GitTabDslPackage.TAB:
      {
        Tab tab = (Tab)theEObject;
        T result = caseTab(tab);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case GitTabDslPackage.BEAT:
      {
        Beat beat = (Beat)theEObject;
        T result = caseBeat(beat);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case GitTabDslPackage.TONE:
      {
        Tone tone = (Tone)theEObject;
        T result = caseTone(tone);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case GitTabDslPackage.STROKE:
      {
        Stroke stroke = (Stroke)theEObject;
        T result = caseStroke(stroke);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case GitTabDslPackage.DOWN_STROKE:
      {
        DownStroke downStroke = (DownStroke)theEObject;
        T result = caseDownStroke(downStroke);
        if (result == null) result = caseStroke(downStroke);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case GitTabDslPackage.UP_STROKE:
      {
        UpStroke upStroke = (UpStroke)theEObject;
        T result = caseUpStroke(upStroke);
        if (result == null) result = caseStroke(upStroke);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case GitTabDslPackage.PAUSE:
      {
        Pause pause = (Pause)theEObject;
        T result = casePause(pause);
        if (result == null) result = caseStroke(pause);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case GitTabDslPackage.HOLD:
      {
        Hold hold = (Hold)theEObject;
        T result = caseHold(hold);
        if (result == null) result = caseStroke(hold);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case GitTabDslPackage.SOUND:
      {
        Sound sound = (Sound)theEObject;
        T result = caseSound(sound);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case GitTabDslPackage.CHORD:
      {
        Chord chord = (Chord)theEObject;
        T result = caseChord(chord);
        if (result == null) result = caseSound(chord);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case GitTabDslPackage.NOTE:
      {
        Note note = (Note)theEObject;
        T result = caseNote(note);
        if (result == null) result = caseSound(note);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case GitTabDslPackage.NOTE_WRAPPER:
      {
        NoteWrapper noteWrapper = (NoteWrapper)theEObject;
        T result = caseNoteWrapper(noteWrapper);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case GitTabDslPackage.FRET:
      {
        Fret fret = (Fret)theEObject;
        T result = caseFret(fret);
        if (result == null) result = caseNoteWrapper(fret);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case GitTabDslPackage.NOTE_NAME:
      {
        NoteName noteName = (NoteName)theEObject;
        T result = caseNoteName(noteName);
        if (result == null) result = caseNoteWrapper(noteName);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      default: return defaultCase(theEObject);
    }
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Tab Model</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Tab Model</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseTabModel(TabModel object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Import</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Import</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseImport(Import object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Tuning</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Tuning</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseTuning(Tuning object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Guitar Str</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Guitar Str</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseGuitarStr(GuitarStr object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Chord Library</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Chord Library</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseChordLibrary(ChordLibrary object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Chord Definition</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Chord Definition</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseChordDefinition(ChordDefinition object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Tab</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Tab</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseTab(Tab object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Beat</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Beat</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseBeat(Beat object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Tone</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Tone</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseTone(Tone object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Stroke</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Stroke</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseStroke(Stroke object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Down Stroke</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Down Stroke</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseDownStroke(DownStroke object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Up Stroke</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Up Stroke</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseUpStroke(UpStroke object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Pause</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Pause</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T casePause(Pause object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Hold</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Hold</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseHold(Hold object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Sound</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Sound</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseSound(Sound object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Chord</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Chord</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseChord(Chord object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Note</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Note</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseNote(Note object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Note Wrapper</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Note Wrapper</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseNoteWrapper(NoteWrapper object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Fret</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Fret</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseFret(Fret object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>Note Name</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>Note Name</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
   * @generated
   */
  public T caseNoteName(NoteName object)
  {
    return null;
  }

  /**
   * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
   * <!-- begin-user-doc -->
   * This implementation returns null;
   * returning a non-null result will terminate the switch, but this is the last case anyway.
   * <!-- end-user-doc -->
   * @param object the target of the switch.
   * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
   * @see #doSwitch(org.eclipse.emf.ecore.EObject)
   * @generated
   */
  public T defaultCase(EObject object)
  {
    return null;
  }

} //GitTabDslSwitch
